#ifndef _ATOS_POWER_TOGGLE_H_
#define _ATOS_POWER_TOGGLE_H_
#include <atos.h>

typedef struct atos_power_toggle_params_t
{
	uint16_t fill_len;
	const char *at_cmd;
	uint8_t at_cmd_len;
	const char *at_ret;
	uint8_t at_ret_len;
	uint16_t wait_data_time; /* Waiting for UART reply data */
	void (*toggle)(atos_uart_fd_t fd); /* The function toggle the power of the module(MC8331, SIM900 or other) */
	uint16_t try_count;
	int8_t matched; /* Matched how much times about the AT response, we can be sure the power is on */
	int8_t missed; /* Negative, Missed how much times about the AT response, we can be sure the power is off */
} atos_power_toggle_params_t;

/* Return if the power is on,
 * poweron:true means we want power on the module, else power off the module */
bool atos_power_toggle(atos_uart_fd_t fd, const atos_power_toggle_params_t *params, bool poweron);

#endif /* _ATOS_POWER_TOGGLE_H_ */
